package com.menhai.personmanagement.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.menhai.personmanagement.entity.HealthEncyclopedia;
import com.menhai.personmanagement.mapper.HealthEncyclopediaMapper;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/HealthEncyclopedia")
public class HealthEncyclopediaController {

	@Autowired
	private HealthEncyclopediaMapper HealthEncyclopediaMapper;
	
	//一级目录
	@RequestMapping("/first")
	public List<HealthEncyclopedia> first (HealthEncyclopedia HealthEncyclopedia){
		List<HealthEncyclopedia> HealthEncyclopediaList = new ArrayList<HealthEncyclopedia>();
		HealthEncyclopediaList = firstMapper(HealthEncyclopedia);
        return HealthEncyclopediaList;
   }
	//二级目录
	@RequestMapping("/secondary")
	public List<HealthEncyclopedia> secondary (HealthEncyclopedia HealthEncyclopedia){
		List<HealthEncyclopedia> HealthEncyclopediaList = new ArrayList<HealthEncyclopedia>();
		HealthEncyclopediaList = secondaryMapper(HealthEncyclopedia);
        return HealthEncyclopediaList;
   }
	//三级目录
	@RequestMapping("/Level")
	public List<HealthEncyclopedia> Level (HealthEncyclopedia HealthEncyclopedia){
		List<HealthEncyclopedia> HealthEncyclopediaList = new ArrayList<HealthEncyclopedia>();
		HealthEncyclopediaList = LevelMapper(HealthEncyclopedia);
        return HealthEncyclopediaList;
   }
	//内容
	@RequestMapping("/content")
	public List<HealthEncyclopedia> content (HealthEncyclopedia HealthEncyclopedia){
		List<HealthEncyclopedia> HealthEncyclopediaList = new ArrayList<HealthEncyclopedia>();
		HealthEncyclopediaList = contentMapper(HealthEncyclopedia);
	    return HealthEncyclopediaList;
	}
	public List<HealthEncyclopedia> firstMapper(HealthEncyclopedia HealthEncyclopedia) {
		return HealthEncyclopediaMapper.first(HealthEncyclopedia);
	}
	public List<HealthEncyclopedia> secondaryMapper(HealthEncyclopedia HealthEncyclopedia) {
		return HealthEncyclopediaMapper.secondary(HealthEncyclopedia);
	}
	public List<HealthEncyclopedia> LevelMapper(HealthEncyclopedia HealthEncyclopedia) {
		return HealthEncyclopediaMapper.Level(HealthEncyclopedia);
	}
	public List<HealthEncyclopedia> contentMapper(HealthEncyclopedia HealthEncyclopedia) {
		return HealthEncyclopediaMapper.content(HealthEncyclopedia);
	}
}
